﻿using Model.ViewModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SYT.AliApiHandle
{
    public class GetApiShopInfo
    {
        // 获取自定义分类和子分类。
        public static ArrayList GetSellerCats(string memberId, string access_token, string catgoryId)
        {
            //从阿里接口获取的当前店铺自定义类目集合
            System.Collections.ArrayList sellerCats = GetSingleProductApi.NewGetSellerCats(memberId, access_token);

            return sellerCats;
        }
        //批量编辑产品
        public static List<ProductModel> GetProListEdit(string PageIndex, string groupIds, string txtSearch, string memberId, out string Currentcount)
        {
            Hashtable hashtable = GetSingleProductApi.ProductSearch(PageIndex, "10", "gmt_post", txtSearch, "", "", "", "", groupIds, "", memberId);

            return HandleProInfo.JieXiProList(hashtable, out Currentcount);
        }


        //获取产品集合
        public static List<ProductModel> GetProlist(string PageIndex, string txtSearch, string qualityLevel, string category, string gmtModifiedBegin, string gmtModifiedEnd, out string Currentcount, string memberId)
        {
            //转换时间格式
            gmtModifiedBegin = HelpMethod.ConvertTimeB(gmtModifiedBegin);
            gmtModifiedEnd = HelpMethod.ConvertTimeB(gmtModifiedEnd);

            category = "";
            Hashtable hashtable = GetSingleProductApi.ProductSearch(PageIndex, "20", "gmt_post", txtSearch, category, gmtModifiedBegin, gmtModifiedEnd, qualityLevel, "", "deleted", memberId);

            return HandleProInfo.JieXiProList(hashtable, out Currentcount);
        }
    }

}
